<?php

namespace App\Http\Controllers\Api\V1;

use App\Http\Controllers\Api\AbstractApiController;
use App\Http\Requests\Sms\SendRequest;
use App\Services\Sms\SmsService;
use Illuminate\Http\JsonResponse;


class SmsController extends AbstractApiController
{
    /**
     * 发送短信
     * @param SendRequest $sendRequest
     * @return JsonResponse
     */
    public function send(SendRequest $sendRequest): JsonResponse
    {
        $mobile=$sendRequest->get("mobile","");
        $send_key=$sendRequest->get("send_key");
        $platform=$sendRequest->get("platform");
        SmsService::send($mobile, $send_key,$sendRequest->getClientIp(),$platform);
        return $this->success(trans("短信发送成功"));
    }
}
